
def computtime(nums):
    n = len(nums)
    res = 0
    for i in range(n):
        res += 1/n * (sum(nums[:i+1]))
    return res

n,m = map(int,input().split())
A = []
for _ in range(n):
    ls = list(map(int,input().split()))
    A.append(ls)

res = 0
for j in range(m):
    ls = []
    for i in range(n):
        ls.append(A[i][j])
    ls.sort()
    res += computtime(ls)
print(res)




